<style>
    .apps-list{overflow: hidden;}
    .apps-list .item{width: 33%;float: left;}
    .apps-list .item > div{padding: 15px;}
    .apps-list .item > div > div{padding-left: 100px;position: relative;height: 80px;}
    .apps-list .item > div > div .icon-box{width: 80px;height: 80px;position: absolute;left: 0px;top:0px;text-align: center;}
    .apps-list .item > div > div .icon-box i{line-height: 80px;font-size: 40px;color: #ffffff;}
    .apps-list .item > div > div .name{line-height: 20px;font-size: 14px;font-weight: bold;color: #4e4e4e;}
    .apps-list .item > div > div .remark{line-height: 20px;font-size: 14px;padding-top: 10px;height: 40px;overflow:hidden;color: #979797;}
</style>
<div class="apps-list">
    <?php if (Cm::$app->limitPost('/platform/sys/auth','refresh')){ ?>
    <div class="item">
        <div>
            <div>
                <a href="javascript:;" onclick="app.refresh()">
                    <div class="icon-box" style="background-color: #ff8c00;">
                        <i class="layui-icon layui-icon-refresh"></i> 
                    </div>
                </a>
                <div class="name">更新权限库</div>
                <div class="remark">更新系统新添加功能的操作权限</div>
            </div>
        </div>
    </div>
    <?php } ?>

    <?php if (Cm::$app->limitGet('/platform/sys/role')){ ?>
    <div class="item">
        <div>
            <div>
                <a href="<?php echo \yii\helpers\Url::to(['sys/role'])?>">
                    <div class="icon-box" style="background-color: #1e9fff;">
                        <i class="layui-icon layui-icon-username"></i> 
                    </div>
                </a>
                <div class="name">角色管理</div>
                <div class="remark">管理员所属角色的添加、编辑、删除、对应的操作权限的设置</div>
            </div>
        </div>
    </div>
    <?php } ?>

    <?php if (Cm::$app->limitGet('/platform/sys/manager')){ ?>
    <div class="item">
        <div>
            <div>
                <a href="<?php echo \yii\helpers\Url::to(['sys/manager'])?>">
                    <div class="icon-box" style="background-color: #ffd700;">
                        <i class="layui-icon layui-icon-user"></i> 
                    </div>
                </a>
                <div class="name">管理员管理</div>
                <div class="remark">系统管理员的添加、编辑、删除</div>
            </div>
        </div>
    </div>
    <?php } ?>
</div>
<script>
    var app = {
        init:function(){
            var height = $(window).height()-145;
            $(".apps-list").css('min-height',height+'px');
        },
        refresh:function () {
            layer.msg('刷新中...', {
                icon: 16
                ,shade: 0.4,
                time:0
            });

            $.post("<?php echo \yii\helpers\Url::to(['sys/auth','action'=>'refresh'])?>",{},function (d) {
                layer.closeAll();
                layer.msg(d.msg);
            },"json");
        }
    }

    app.init();
</script>